<%--
  Created by IntelliJ IDEA.
  User: 李毅
  Date: 2023/8/15
  Time: 10:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="path" value="${pageContext.request.contextPath }"/>
<html>
<head>
    <title>修改电影信息</title>
    <script type="text/javascript" rel="script" src="${path}/js/jquery-3.6.4.js"></script>
    <link href="${path}/css/updateMovie.css" rel="stylesheet" type="text/css">
</head>
<body>
<c:set var="movie" value="${requestScope.moi}"/>
<div class="action  divaction">
    <div class="t">
        修改电影信息
    </div>
    <form method="post" action="${path}/UpdateMovieServlet?prom=updMovie&movie_id=${movie.movie_id}" enctype="multipart/form-data">
        <div class="b2">
            <ul>
                <hr>
                <li>
                    <p>剧照上传</p>
                    <div class="a2">
                        <img id="moviePirture"  src="${path}/images/moviePicture/${movie.movie_picture}" >
                    </div>
                    <input type="button" value="选择文件" id="buttonx"><input id="file" type="file" multiple="multiple" name="movie_picture" value="${movie.movie_picture}">
                </li>
                <li>
                    <p>
                    <div class="a3">
                        <span class="b1">电影名称-中文</span>
                        <input type="text" placeholder="请输入电影名" class="a4" name="movie_cn_name" value="${movie.movie_cn_name}"/>
                    </div>
                    </p>
                </li>
                <li>
                    <p>
                    <div class="a3">
                        <span class="b1">电影名称-外语</span>
                        <input type="text" placeholder="请输入电影名" class="a4" name="movie_fg_name" value="${movie.movie_fg_name}"/>
                    </div>
                    </p>
                </li>
                <li>
                    <p>
                    <div class="a3">
                        <span class="b1">电影类型</span>
                    </div>
                    <input type="text" class="a4" name="movie_type" value="${movie.movie_type}"readonly="readonly"/>
                    </p>
                </li>
                <li>
                    <p>
                    <div class="a3">
                        <span class="b1">电影地区</span>
                        <input type="text" placeholder="中国大陆" class="a4" name="movie_country" value="${movie.movie_country}"/>
                    </div>
                    </p>
                </li>
                <li>
                    <p>
                    <div class="a3">
                        <span class="b1">电影导演</span>
                        <input type="text" placeholder="请填写电影导演" class="a4" name="movie_director" value="${movie.movie_director}"/>
                    </div>
                    </p>
                </li>
                <li>
                    <p>
                    <div class="a3">
                        <span class="b1">电影主演</span>
                        <input type="text" placeholder="请填写电影主演" class="a4" name="movie_actor" value="${movie.movie_actor}"/>
                    </div>
                    </p>
                </li>
                <li>
                    <p>
                    <div class="a3">
                        <span class="b1">电影片长</span>
                        <input type="text" placeholder="请填写电影片长(单位:分钟)" class="a4" name="movie_duration" value="${movie.movie_duration}"/>
                    </div>
                    </p>
                </li>
                <li>
                    <p>
                    <div class="a3">
                        <span class="b1">上映时间</span>
                        <input type="text" placeholder="请输入电影上映日期" class="a4" name="movie_releaseDate" value="${movie.movie_releaseDate}"/>
                    </div>
                    </p>
                </li>
                <li>
                    是否上映:
                    <c:if test="${movie.movie_state=='1'}">
                        <input type="radio" name="movie_state" value="1" checked>在线
                        <input type="radio" name="movie_state" value="2">预售
                        <input type="radio" name="movie_state" value="3">下架
                    </c:if>
                    <c:if test="${movie.movie_state=='2'}">
                        <input type="radio" name="movie_state" value="1" >在线
                        <input type="radio" name="movie_state" value="2" checked>预售
                        <input type="radio" name="movie_state" value="3" >下架
                    </c:if>
                    <c:if test="${movie.movie_state=='3'}">
                        <input type="radio" name="movie_state" value="1" >在线
                        <input type="radio" name="movie_state" value="2" >预售
                        <input type="radio" name="movie_state" value="3" checked>下架
                    </c:if>
                </li>
                <li>
                    <input type="submit" value="修改" class="a9">
                    <input type="button" value="返回" class="a9" onclick="javascript:window.location='inquireMovie.jsp'">
                </li>
            </ul>
        </div>
    </form>
</div>
<script>
    $("#file").change(function () {
        //获取文件名称
        var url=document.getElementById('file').files[0].name;
        $("#moviePirture").attr("src","${path}/images/moviePicture/"+url);
        //获取文件全部路径
        var urlPath=document.getElementById('file').value;
    });
</script>
</body>
</html>
